import instance from '../../utils/request.js'

// 用户详细信息注册
export const registerDetailAPI = (data) => {
  const { avatarUrl, username, userId, sex, college, className, admissionYear, schoolYearSystem, role, password } = data
  return instance({
    url: '/api/users/register',
    method: 'POST',
    data: { avatarUrl, username, userId, sex, college, className, admissionYear, schoolYearSystem, role, password }
  })
}

// 用户注册
export const loginAPI = (data) => {
  const { userId, password, role } = data
  return instance({
    url: '/api/users/login',
    method: 'POST',
    data: { userId, password, role }
  })
}